package com.mes.biz.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.mes.common.annotation.Excel;
import com.mes.common.core.domain.BaseEntity;
import com.mes.common.utils.log.annotation.FieldRemark;
import com.mes.common.utils.log.annotation.LogField;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import javax.validation.constraints.NotBlank;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 销售单对象 biz_order
 * @author hwg
 * @email hwg
 * @date 2023-05-15
 */
@Data
public class BizOrder extends BaseEntity<BizOrder>
{
    private static final long serialVersionUID = 1L;

    /** 订单编号 */
    @Excel(name = "订单编号")
    @LogField
    @FieldRemark(name = "订单编号",field = "orderNumber")
    private String orderNumber;

    @FieldRemark(name = "项目ID",field = "projectId")
    private String projectId;

    @FieldRemark(name = "项目编号",field = "projectNumber")
    private String projectNumber;

    /** 客户 */
    @Excel(name = "客户", dictType = "order_type")
    @NotBlank(message = "客户不允许为空")
    @LogField
    @FieldRemark(name = "客户",field = "customerId")
    private String customerId;

    @FieldRemark(name = "客户",field = "customerName")
    private String customerName;

    private String deptIdName;
    /** 订单日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "订单日期", width = 30, dateFormat = "yyyy-MM-dd")
    @LogField
    @FieldRemark(name = "订单日期",field = "orderDate")
    private Date orderDate;

    /** 订单日期开始 */
    private String beginOrderDate;

    /** 订单日期结束 */
    private String endOrderDate;

    /** 送货地址 */
    @Excel(name = "送货地址")
    @LogField
    @FieldRemark(name = "送货地址",field = "address")
    private String address;

    /** 业主电话 */
    @Excel(name = "业主电话")
    @LogField
    @FieldRemark(name = "业主电话",field = "phone")
    private String phone;

    /** 安装时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "安装时间", width = 30, dateFormat = "yyyy-MM-dd")
    @LogField
    @FieldRemark(name = "安装时间",field = "installDate")
    private Date installDate;

    /** 安装时间开始 */
    private String beginInstallDate;

    /** 安装时间结束 */
    private String endInstallDate;

    @FieldRemark(name = "销售金额",field = "saleAmount")
    private BigDecimal saleAmount;

    @FieldRemark(name = "收款金额",field = "collectedAmount")
    private BigDecimal collectedAmount;

    /** 开单员 */
    @Excel(name = "开单员")
    @LogField
    @FieldRemark(name = "开单员",field = "biller")
    private String biller;

    private String billerName;
    /** 接单日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "接单日期", width = 30, dateFormat = "yyyy-MM-dd")
    @LogField
    @FieldRemark(name = "接单日期",field = "receiveDate")
    private Date receiveDate;

    /** 接单日期开始 */
    private String beginReceiveDate;

    /** 接单日期结束 */
    private String endReceiveDate;

    /** 清账发货 */
    @Excel(name = "清账发货", dictType = "sys_yes_no")
    @LogField
    @FieldRemark(name = "清账发货",field = "isSettleSend")
    private String isSettleSend;

    /** 订单类型 */
    @Excel(name = "订单类型", dictType = "order_type")
    @LogField
    @FieldRemark(name = "订单类型",field = "orderType")
    private String orderType;

    /** 订单条码 */
    @Excel(name = "订单条码")
    private String orderQrCode;

    /** 水槽到货 */
    @Excel(name = "水槽到货")
    private String sinkArrival;

    /** 原订单 */
    private String originalOrder;

    /** 租户id */
    private String tenantId;

    /** 订单状态 */
    @Excel(name = "订单状态")
    private String orderStatus;

    private String auditStatus;

    private String productId;

    private List<String> attachList;

    private List<String> installAttachList;

    private List<BizOrderProduct> productList;

    private List<BizOrderMaterial> materialList;

    private List<BizProductProcessDetail> processList;

    private List<BizOrderProcessRecord> recordList;

    // 安装员
    private List<String> userList;

    private String flag;
    //小程序 1-未完成 2-已完成
    private String processStatus;
    //小程序 1-未提交 2-已受理 3-已处理
    private String aftermarketStatus;
    //客户上传售后附件
    private List<String> customerAttachList;
    //售后处理的附件
    private List<String> afterAttachList;
    //售后处理的附件
    private List<String> installerAttachList;
    //销售单id
    private String afterSaleId;

    private String productPositon;

    private String remarkA;

    private String remarkB;

    private String[] status;

    @FieldRemark(name = "配送模式 1-客户自提 2-工厂配送",field = "deliveryType")
    private String deliveryType;

    @FieldRemark(name = "安装模式 1-无安装 2-包安装",field = "installType")
    private String installType;

    @FieldRemark(name = "成品仓库id",field = "productWarehouseId")
    private String productWarehouseId;
    @FieldRemark(name = "成品仓库",field = "productWarehouse")
    private String productWarehouse;

    private List<BizOrderInstaller> bizOrderInstallers;

    /**
     * 配件id
     */
    private String accessoryId;

    /**
     * 配件文件路径
     */
    private String accessoryFileList;

    /**
     * 配件备注
     */
    private String accessoryRemark;
    //状态 0-已分配 1-已接收 2-已完成
    private String installerStatus;
    //类型 1-配送  2-安装
    private String installerType;
    private String installerId;
    private String newRemark;

    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date installerDate;
    private String installerUserId;

    private String showEndStatus;
    @FieldRemark(name = "发货状态 0-未发货 1-已发货",field = "shippingStatus")
    private String shippingStatus;

    private boolean addressRepetition;

    private String startDate;
    private String endDate;
    private String condition;

    private String orderPrefix;

    private String measureId;

    private String creator;
    private String customernanName;
    @FieldRemark(name = "订单类型",field = "customernan")
    private String customernan;

    private String deliveryPerson;
    private String installerPerson;
    private String warningStatus;
    private BigDecimal cost1;
    private BigDecimal cost2;
    private BigDecimal cost3;
    private BigDecimal cost4;
    private BigDecimal cost5;
    private BigDecimal cost6;
    private BigDecimal cost7;
    private BigDecimal cost8;
    private BigDecimal cost9;
    private BigDecimal cost10;
    private BigDecimal balance;
}
